import request from '@/utils/request' // 策略  strategy
// 查询售货机策略
export function getStrategy(innerCode) {
  return request({
    url: `/api/vm-service/policy/vmPolicy/${innerCode}`,
    method: 'get'
  })
}

// 取消策略
export function CancellationPolicy(StrategyList) {
  return request({
    url: `/api/vm-service/vm/cancelPolicy/${StrategyList.innerCode}/${StrategyList.policyId}`,
    method: 'PUT'
  })
}
// 获取策略列表  strategy
export function getstrategyList() {
  return request({
    url: `/api/vm-service/policy`,
    method: 'GET'
  })
}
// 搜索策略 /api/vm-service/policy/search
export function getceluo(params) {
  return request({
    url: `/api/vm-service/policy/search`,
    method: 'GET',
    params
  })
}

// 新增策略 /api/vm-service/policy
export function POSTceluo(data) {
  return request({
    url: `/api/vm-service/policy`,
    method: 'POST',
    data
  })
}
// 修改策略 /api/vm-service/policy/:policyId
export function PUTceluo(data, id) {
  return request({
    url: `/api/vm-service/policy/${id}`,
    method: 'PUT',
    data
  })
}
// 删除策略 /api/vm-service/policy/:policyId
export function DELETEcelue(id) {
  return request({
    url: `/api/vm-service/policy/${id}`,
    method: 'DELETE'
  })
}
// 根据策略搜索售货机  /api/vm-service/policy/vmList/:policyId
export function GETceluoji(params, id) {
  return request({
    url: `api/vm-service/policy/vmList/${id}`,
    method: 'get',
    params
  })
}
